class Comment < ActiveRecord::Base
  belongs_to :article
  belongs_to :user
  
  before_save :set_published_date
  
  validates_presence_of :content
  
  protected
  def set_published_date
    self[:published_at] = Time.now
  end
end
